# -*- coding: utf-8 -*-
# @Time    : 2022/7/15 22:12
# @Author  : catherine
# @Email   : catherine_csq@163.com
# @File    : clue_home_page.py
# @Software: PyCharm

from selenium.webdriver.common.by import By
from pages.base_page import BasePage

class ClueHomePage(BasePage):
    '''线索主页类'''
    url='http://192.168.189.1:8081/crm/index.php?m=leads'
    #定位器
    add_clue_locator = (By.XPATH, '/html/body/div[5]/div[2]/div[1]/div/a')
    clues_pool_locator = (By.XPATH, '/html/body/div[5]/div[1]/ul/li[2]/a')
    check_clue_locator = (By.LINK_TEXT, '查看')

    # def open(self):
    #     '''打开页面'''
    #     self.driver.get(self.url)
    #
    # def current_url(self):
    #     '''获取当前界面url'''
    #     return self.driver.current_url

    def add_clue(self):
        '''点击新建线索，将进入到新建线索界面'''
        # self.driver.find_element(*self.add_clue_locator).click()
        self.find_element(self.add_clue_locator).click()

    def click_clue_poll(self):
        '''点击线索池，将进入到线索池界面'''
        # self.driver.find_element(*self.clues_pool_locator).click()
        self.find_element(self.clues_pool_locator).click()

    def click_check_clue(self):
        '''点击查看，将进入线索详情页'''
        self.find_element(self.check_clue_locator).click()



